package servlet;

import dao.UserDao;
import dao.impl.UserDaoImpl;
import org.apache.commons.lang3.StringUtils;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class Vip_deleteServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String id=req.getParameter("vipId");
        if (StringUtils.isNotBlank(id)){
            Integer vipId=Integer.parseInt(id);
            UserDao userDao=new UserDaoImpl();
            userDao.vip_delete(vipId);
        }
        resp.sendRedirect("./vip_findall");

    }
}
